package com.bailun91.auth.service.Impl;

import com.bailun91.auth.entity.Permission;
import com.bailun91.auth.mapper.PermissionMapper;
import com.bailun91.auth.service.PermissionService;
import com.bailun91.auth.shiro.ShiroFilterChainManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PermissionServiceImpl implements PermissionService {

    @Autowired
    PermissionMapper permissionMapper;

    @Autowired
    ShiroFilterChainManager shiroFilterChainManager;
    @Override
    public List<Permission> findAllPermissions() {
        return permissionMapper.findAllPermissions();
    }

    /**
     * 更新shiro全局权限
     */
    @Override
    public void updateGlobalPermission() {
        shiroFilterChainManager.updatePermission();
    }
}
